<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<h1>修改用户数据</h1>
<% 
    request.setCharacterEncoding("utf-8");
    String userid = request.getParameter("id"); 
    String name = "",pwd = "",phone = "",email = "",address = "";
    javax.sql.rowset.WebRowSet rs = aa.db.DBTools.getRS("SELECT * FROM customer WHERE userid='" + userid + "'");
        while(rs.next()){ 
            name = rs.getString("name");
            pwd = rs.getString("pwd");
            phone = rs.getString("phone");
            email = rs.getString("email");
            address = rs.getString("address");
        }
    
                rs.close();
%>
<form action="save.jsp" method="post">
    <label for="userid">userid:</label>
    <input type="text" id="userid" name="userid" value="<%=userid%>"><br>
    <label for="name">name:</label>
    <input type="text" id="name" name="name" value="<%=name%>"><br>
    <label for="pwd">pwd:</label>
    <input type="password" id="pwd" name="pwd" value="<%=pwd%>"><br>
    <label for="phone">phone:</label>
    <input type="text" id="phone" name="phone" value="<%=phone%>"><br>
    <label for="email">email:</label>
    <input type="email" id="email" name="email" value="<%=email%>"><br>
    <label for="address">address:</label>
    <input type="text" id="address" name="address" value="<%=address%>"><br>

    <input type="submit" name="btn" value="修改"><br>
    <input type="submit" name="btn" value="新增"><br>
</form>
</body>
</html>
